package com.j2some;



import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.Map;

import org.apache.commons.collections.map.HashedMap;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;

import com.yinquan.util.DataUtil;
import com.yinquan.util.FileUtill;
import com.yinquan.util.GetNumber;
import com.yishun.springboot.Application;
import com.yishun.springboot.mapper.GwsCWRMapper;
import com.yishun.springboot.service.GongWuSuUploadCWSService;
import com.yishun.springboot.service.InnerFormalGWSCWRService;

import lombok.extern.slf4j.Slf4j;

/**
 * 过程测试
 * 工务署实名制各业务
 * @date   2021年5月7日上午10:52:51 
 * @author XiaoHuang
 *
 */
@Slf4j
//@RunWith(SpringRunner.class)
//@SpringBootTest(classes = Application.class)
public class ProcessTestlitile3 {

	
//	@Autowired
//	GwsCWRMapper gwsCWRMapper;
	
	
//	@Autowired
//	InnerFormalGWSCWRService innerFormalGWSCWRService;
//	
//	@Autowired
//	GongWuSuUploadCWSService gongWuSuUploadCWSService;
	
	@Test
	public void uploadPersonnel() throws Exception {
		
//		String pathName  = "C:\\Users\\95664\\Desktop\\1.jpg";
//		String fileName = FileUtill.getFileName(pathName, "\\");
//		FileUtill.getFilePath(pathName, "\\");
//		
//		log.info(FileUtill.tempChangeFileTypeOnly(fileName,"jpeg"));
		
		String pathName  = "C:\\Users\\95664\\Desktop\\1.jpg";
		FileUtill.ChangeFileType(pathName,"jpg","jpeg");
		 
//		Map a = new HashedMap();
//		List b = new ArrayList<>();
//		for (int i = 0; i < 3; i++) {
//			a.put("第"+i+"个", i);
//			b.add(a);
//		}
//		
//		log.info("b:"+b);
//		
//		String a = "662450dafabb46c9a34e2e5dc62926a0";
//		log.info(a.equals("662450dafabb46c9a34e2e5dc62926a0"));
		
//		String headImagePath = "http://img.yishun618.com/def/def2/test.jpg";
//		headImagePath = headImagePath.substring(headImagePath.lastIndexOf("/")+1);
//		log.info("headImagePath:"+headImagePath);
//		
//		log.info(GetNumber.getScopeNumber(1,59));
		
		
//		String filePath = "C:\\Users\\Administrator\\Desktop\\1\\233.jpg";
//		String a = innerFormalGWSCWRService.UploadImage(filePath);
//		log.info("a:"+a);
//		
//		long current=System.currentTimeMillis();//当前时间毫秒数
//        long zero=current/(1000*3600*24)*(1000*3600*24)-TimeZone.getDefault().getRawOffset();//今天零点零分零秒的毫秒数
//        long twelve=zero+24*60*60*1000-1;//今天23点59分59秒的毫秒数
//        long yesterday=System.currentTimeMillis()-24*60*60*1000;//昨天的这一时间的毫秒数
//        log.info(new Timestamp(current));//当前时间
//        log.info(new Timestamp(yesterday));//昨天这一时间点
//        log.info(new Timestamp(zero));//今天零点零分零秒
//        log.info(new Timestamp(twelve));//今天23点59分59秒
//		
//		GwsProjectAttendanceListNew gwsProjectAttendanceListNew = new GwsProjectAttendanceListNew();
//		gwsProjectAttendanceListNew.setGws_projectcode("");
//		gwsProjectAttendanceListNew.setIdcardnumber("");
//		gwsProjectAttendanceListNew.setPassed_time("2021-02-04 09:27:07");
//		
//		gwsCWRMapper.innerOneRecordProjectAttendanceListNew(gwsProjectAttendanceListNew);
//		String standardProjectName = "十五高级中学"; // 可修改为你需要改成的库表内的【标准项目名】
//		gongWuSuUploadCWSService.personnelLeaveProjectByStandardProjectNameOrWorkerName(standardProjectName,"陈相吕");
		
//		personnelLeaveProjectByIdCardNumber
//		List<YzwProjectAttendanceListNew> l = gwsCWRMapper.selectAttendancelistnewByIDCardNumberAndTime("332626198007113034", null);
//		log.info(":"+l.size());
		
//		String str = "丰畅木工班";
//		Dictionary dictionary = new Dictionary();
//		String patternStr = dictionary.yzwAndGwsOfTeamDictionary(str);
//		GwsTeamType gwsTeamType = gwsCWRMapper.selectGwsTeamTypeLikeTeamName(patternStr);
//		log.info("gwsTeamType:"+gwsTeamType);
		
//		 String string1 = "我爱编w!@#程  www#";
//		String regEx="[`~!@#$%^&*()+=|{}:;\\[\\].<>/?~！@#￥%……&*（）——+|{}【】‘；：”“’。，、？a-zA-Z0-9 ]";
//		Pattern c = Pattern.compile(regEx);
//		Matcher mc=c.matcher(string1);
//		while(mc.find()){
//			log.info(mc.group());
//			}
//		String result = mc.replaceAll("").trim();
//		log.info(result);
//		
//		Pattern p = Pattern.compile("[编][程]");
//		Matcher m = p.matcher(result);
//		while(m.find()){
//		log.info(m.group());
//		}
		
		
		
//		String string1 = "丰畅砌筑班";
////		String regEx="[`~!@#$%^&*()+=|{}:;\\[\\].<>/?~！@#￥%……&*（）——+|{}【】‘；：”“’。，、？a-zA-Z0-9 ]";
//		Pattern c = Pattern.compile("[班]?");
//		Matcher mc=c.matcher(string1);
//		while(mc.find()){
//			log.info(mc.group(mc.end()));
//			}
//		String result = mc.replaceAll("").trim();
//		log.info(result);
		

//		Integer yzwProjectCode = 325437;
//		List<YzwWorkerList> yl = gwsCWRMapper.selectPresenceOfWorkerList(yzwProjectCode, "yes");
//		
//		YzwSubContractorList yzwSubContractorList = null;
//		GwsDictListJobName gwsDictListJobName = null;
//		log.info("ylsize:"+yl.size());
//		
//		UploadGWSAddTeam uploadGWSAddTeam = new UploadGWSAddTeam();
//		innerFormalGWSCWRService.addTeamTest(uploadGWSAddTeam);
		
//		for (YzwWorkerList yzwWorkerList : yl) {
//			for (YzwSubContractorList yzwSubContractorList : yzwWorkerList.getYzwSubContractorList()) {
//				log.info("个人id："+yzwWorkerList.getIDCardNumber()+".个人的分包商信息:"+yzwSubContractorList);			
//			}
				
				
//				yzwSubContractorList = yzwWorkerList.getYzwSubContractorList();
//			gwsDictListJobName = yzwWorkerList.getGwsDictlistJobname();
//			log.info("gwsDictListJobName:"+gwsDictListJobName);
			
		
//			log.info("分包商信息为空了！");
//			continue;
			
//		}

	}
	
	
	//手动人员离场
//	public void manualPersonnelLeaveProject() {
//		String gwsProjectCode = "SZSW-009-2020"; // 可修改为你需要改成工务署项目号
//		String iDCardNumber = "450902199712232210";
//		String SUID = "9142011273751680aq";
//		gongWuSuUploadCWSService.manualPersonnelLeaveProject(gwsProjectCode, iDCardNumber, SUID);
//	}

}